<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link href="Public/Home/css/cart.css" type="text/css" rel="stylesheet"  /> 
		<!--购物车样式-->
		<link href="Public/Home/css/cartbox.css" type="text/css" rel="stylesheet"  />
		<style type="text/css">
			#NOT{color:#C00;}
			/*  弹出层  */
			#yonghu,#mima{width:300px;height:30px;margin:10px auto 0px;color:#6D6D6D;font-size:14px;}
			#txt,#pwd,#pwd2{width:200px;height:24px;outline:none;border-radius:4px;border:1px solid #9D9D9D;}
			
			#anniuBox{width:120px;height:36px;margin:20px auto;}
			#regAnniu,#loginAnniu{width:120px;height:36px;background:#87B1BD;color:#FFF;line-height:36px;text-align:center;font-size:14px;font-weight:700;border:none;outline:none;margin:0px auto;border-radius:4px;}
			/* 弹出层_ok */
			.redWord{text-decoration: underline;color:#C00;background:#F68567;padding:2px 5px;}
		</style>	
		<script type="text/javascript" src="Public/Home/js/jquery-1.9.1.min.js"></script>
		<link rel="stylesheet" type="text/css" href="Public/Home/css/jquery.dialogbox.css" />
		<script type="text/javascript" src="Public/Home/js/jquery.dialogBox.js"></script>	
		<script type="text/javascript">
			$(function(){
				$('.closing').click(function(){
					alert(1);
					var username = 	"{{$_SESSION['username']}}"; //{{$_SESSION['user']}}必须用""包裹
					alert(username);
					if(username == '' || username == null){  //当{{$_SESSION['user']}}等于'' 或者等于 NULL的时候
						alert('登录');
						var code = "{{U('Reg/code')}}";
							$('#login-dialogBox').dialogBox({
								width: 500,
								height: 300,
								title: '用户登录',
								hasClose: true,
								content: '<form action="index.php?c=Login&a=login" method="post"><p style="margin-top:10px;" id="yonghu">&nbsp;&nbsp;&nbsp;&nbsp;用户名&nbsp;:&nbsp;<input type="text" name="username" id="txt"  placeholder="&nbsp;&nbsp;Username"/></p><p id="mima">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;密&nbsp;码&nbsp;&nbsp;:&nbsp;<input type="password" name="password" id="pwd"  placeholder="&nbsp;&nbsp;Password"/></p><p id="mima">&nbsp;&nbsp;&nbsp;&nbsp;验证码&nbsp;:&nbsp;<input type="text" name="code" id="txt" /></p><p id="mima">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="auto" id="" /> 7天免登陆<img src="'+code+'" onclick="this.src = this.src + \'&rand=\' + Math.random()"/></p><p id="anniuBox"><input type="submit" value="登&nbsp;录" id="loginAnniu" /></p></form>'
							});
					}else{
						alert('跳转到购物车');
					}	
				})
			})
		</script>
	</head>
	<body>
		<!--  登录弹出层  -->
		<div id="login-dialogBox"></div>
		<!--headerBegin-->
		<!--header-->
		<div id="topnav">
			<div class="wbox clearfix">
				<!--left-->
				<ul class="topside">
					<li id="topNavHover" class="vphone">
						<b></b>
						<a href="#" target="_blank">手机国美</a>
						<div class="vphone-down">
							<a href="#" target="_blank"></a>
							<em class="i-angle"><i></i></em>
						</div>
					</li>
					<li><a href="#" target="_blank" title="国之美">国之美</a></li>
					<li><a href="#" target="_blank" title="多边黄金">多边黄金</a></li>
				</ul>
				<!--right-->
				<ul class="topmenu clearfix">
					<li class="login-top">
						<span class="gwelcome">国美在线欢迎您！</span>
						<!--只要$_SESSION里面有name就算登录-->
                		<?php if(isset($_SESSION['username'])): ?>
                			您好，<?php echo $_SESSION['username'] ?>
                			<a class="glogin" href="{{U('Login/out')}}">退出</a>
                		<?php else: ?>
                			<a class="glogin" href="{{U('Login/index')}}">登录</a>   
                		<?php endif ?>
						<a class="gsign" href="#">注册</a>
					</li>
					<li class="linespace"></li>
					<li class="g-myoder"><a  href="#">我的订单</a></li>
					<li><a  href="#">我的国美</a></li>
					<li class="linespace"></li>
					<li class="g-myoder"><a  href="#">在线客服</a></li>
					<li><a  href="#">服务中心</a></li>
					<li class="g-myoder"><a  href="#">企业服务</a></li>
					<li><a  href="#">国美社区</a></li>
					<li class="g-myoder"><a  href="#">商家入驻</a></li>
				</ul>
			</div>
		</div>
		<!--header_ok-->
		<!--headerEnd-->
				
		<!--topEnd-->
			
		<!--logo-->
		<div class="nMain">
			<!--顶部logo,当前订单阶段-->
			<div class="nTop clearfix">
				<h1 class="logo">
					<a href="#"><img src="Public/Home/images/skin/gomelogo.png" width="200" height="43" /></a>
				</h1>
				<ul class="steps nLowLeight">
					<li class="last">
						<b>3</b>
						<em class="f">成功提交订单</em>
					</li>
					<li>
						<b>2</b>
						<span class="going"></span>
						<em class="f">填写核对订单信息</em>
					</li>
					<li class="first prev cur">
						<b>1</b>
						<span class="going"></span>
						<em class="f">我的购物车</em>
					</li>
				</ul>
			</div>
			<!--顶部logo,当前订单阶段_ok-->
			
			<!--商品列表-->
			<div id="products-gome">
				<div class="nMyCartName"><b class="name">我的购物车</b></div>
				<div class="in-products">
					<!--上-->
					<!--中-->
					<!--下-->
					<div class="products-all-box"></div>
				</div>
			</div>
			<!--商品列表_ok-->
						
			<!--购物车源码-->		 
			<table id="cartTable">
			    <thead>
			        <tr>
			            <th><label><input class="check-all check" type="checkbox"/>&nbsp;全选</label></th>
			            <th>商品</th>
			            <th>单价</th>
			            <th>数量</th>
			            <th>小计</th>
			            <th>操作</th>
			        </tr>
			    </thead>
			    <tbody>
			    	{{foreach from="$_SESSION['cart']['goods']" key="$k" value="$v"}}
			        <tr>
			            <td class="checkbox"><input class="check-one check" type="checkbox"/></td>
			            <td class="goods"><img src="{{$v['options']['pic']}}" alt=""/
							<span>{{$v['name']}} | {{$v['options']['size']}} | {{$v['options']['color']}}</span>
						</td>
			            <td class="price">{{$v['price']}}</td>
			            <td class="count">
			                <span class="reduce"></span>
			                <input class="count-input" type="text" value="{{$v['num']}}"/>
			                <span class="add">+</span></td>
			            <td class="subtotal">
			            		{{  intval($v['price'])*intval($v['num'])   }}	            	
			            </td>
			            <td class="operation"><span class="delete">删除</span></td>
			        </tr>			       
			        {{endforeach}}
			    </tbody>
			</table>
			
			<div class="foot" id="foot">
			    <label class="fl select-all"><input type="checkbox" class="check-all check"/>&nbsp;全选</label>
			    <a class="fl delete" id="deleteAll" href="javascript:;">删除</a>
			    <a class="fr closing" href="javascript:;">结 算</a>
			    <div class="fr total">合计：￥<span id="priceTotal">0.00</span></div>
			    <div class="fr selected" id="selected">已选商品
			        <span id="selectedTotal">0</span>件
			        <span class="arrow up">︽</span>
			        <span class="arrow down">︾</span>
			    </div>
			    <div class="selected-view">
			        <div id="selectedViewList" class="clearfix">
			            <!--<div><img src="images/1.jpg"><span>取消选择</span></div>-->
			        </div>
			        <span class="arrow">◆<span>◆</span></span>
			    </div>
			</div>		
			<script type="text/javascript" src="Public/Home/js/cart.js"></script>
			<!--购物车源码_ok-->
		</div>
		<!--l_ok-->	
		

		<!--footer-->
		{{include file="VIEW_PATH/Common/smallFooter.php"}}
		<!--footer_ok-->		
	</body>
</html>
